// 用于测试代码

var after = require('after');

var after = require("after")
    , next = after(3, logError, errHandle)

next(1)
next(2)
next(123)
// next(new Error("oops")) // logs oops 
// next() // does nothing 

// This callback is only called once. 
// If there is an error the callback gets called immediately 
// this avoids the situation where errors get lost. 
function logError(err) {
    console.log(err)
}

function errHandle(err) {
    console.log(err);
}